<extend name="common:commonTemplate" />
<block name="main_content">
<div id="content">
	<div id="content-header">
		<div id="breadcrumb">
			<a class="tip-bottom" href="index.html"
				data-original-title="Go to Home"><i class="icon-home"></i> 首页</a> <a
				href="#">权限管理</a> <a class="current" href="#">新增domain</a>
		</div>
	</div>
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon"> <i class="icon-info-sign"></i>
						</span>
						<h5>domain信息</h5>
					</div>
					<div class="widget-content nopadding">
						<form novalidate="novalidate" id="basic_validate"
							name="basic_validate" action="#" method="post"
							class="form-horizontal">
							<div class="control-group">
								<label class="control-label">系统名称</label>
								<div class="controls">
									<input type="text" id="domain_name" name="sku_sn"/>
								</div>
							</div>
							<div class="control-group">
								<label class="control-label">域</label>
								<div class="controls">
									<input type="text" id="domain_url" name="sku_name">
								</div>
							</div>
							
							<div class="control-group">
								<label class="control-label">默认链接（home页）</label>
								<div class="controls">
									<input type="text" id="default_url" name="sku_name">
								</div>
							</div>
							
							<div class="control-group">
								<a id="btn_add" class="btn btn-success">新增系统域</a> 
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
</block>

<block name="js_content"> 
<script>
//新增商品
$('#btn_add').bind('click', function(){
	var domain_name = $('#domain_name').val();
	var domain_url = $('#domain_url').val();
	var default_url = $('#default_url').val();
	
	if(domain_name==''){
		alert("系统名称不可为空");
		return;
	}
	
	if(domain_url==''){
		alert("域不可为空");
		return;
	}
	
	if(default_url==''){
		alert("默认链接不可为空");
		return;
	}
	
	var result = AuthService.adddomain(domain_name,domain_url,default_url);
	if (result.IsSuccess == 0) {
		alert(result.ErrorMsg);
		return;
	} else {
		alert('新增成功');
	}
});
</script>

 </block>